#ifndef StartStop_H
#define StartStop_H

#include "../../../../nemosomen/DataModel/src/nemosomenBase.h"
#include "DataProtocol.h"

class StartStop : public Action
{
public:
	StartStop(){
		
	}
	virtual ~StartStop() {}
	void execute(AttributeHolder *attribs){

		Texture *t = DisplayProtocol::getSelectedTexture(attribs);
		int currentVal = t->startStop->get();
		if (currentVal==1) {
			t->startStop->set(0);
		}
		else {
			t->startStop->set(1);
		}
	}

};

class BeginAction : public Action
{
public:
	BeginAction(){
		
	}
	virtual ~BeginAction() {}
	void execute(AttributeHolder *attribs){

		Texture *t = DisplayProtocol::getSelectedTexture(attribs);
		t->start->set((int)t->current->get());
	}

};

class EndAction : public Action
{
public:
	EndAction(){
		
	}
	virtual ~EndAction() {}
	void execute(AttributeHolder *attribs){

		Texture *t = DisplayProtocol::getSelectedTexture(attribs);
		t->stop->set((int)t->current->get());
	}

};

class ClearStartStopAction : public Action
{
public:
	ClearStartStopAction(){
		
	}
	virtual ~ClearStartStopAction() {}
	void execute(AttributeHolder *attribs){

		Texture *t = DisplayProtocol::getSelectedTexture(attribs);
		t->start->set(0);
		t->stop->set(t->length->get());
	}

};

#endif /*StartStop_H*/



